/**
 *  created by Marcello on 2018/4/26.
 */
import '../../utils/concrete'
/* eslint-disable */

export  function fetchListOrg(query,dataForm) {
  // delete dataForm.parentorgname
  const data={
    num:query.page,
    pageSize: query.limit,
    condition:{
      orgbh: dataForm.orgbh,
      orgname: dataForm.orgname,
      orglevel : dataForm.orglevel,
      parentorg: dataForm.parentorg, orgtype: dataForm.orgtype, header: dataForm.header
    }
  }
  return concrete.module('SysorgService').selectSysorgs(data)
}
export function deleteListOrg(list) {
  const deleteList=[]
 for (var i = 0; i < list.length; i++){
    deleteList.push(list[i].orgno)
 }
 console.log(deleteList)
  return concrete.module('SysorgService').deleteSysorgs(deleteList)
}
export function createOrg(createOrg) {
  const data={
    orgbh: createOrg.orgbh,
    orgno: createOrg.orgno,
    orgname: createOrg.orgname,
    orglevel: createOrg.orglevel,
    orgtel: createOrg.orgtel,
    parentorg: createOrg.parentorg,
    parentorgname: createOrg.parentorgname, orgtype: createOrg.orgtype, header: createOrg.header, headername: createOrg.headername
  }
  return concrete.module('SysorgService').addSysorg(data)
}
export function updateOrg(updateOrg) {
  const data={
    orgbh: updateOrg.orgbh,
    orgno: updateOrg.orgno,
    orgname: updateOrg.orgname,
    orglevel: updateOrg.orglevel,
    orgtel: updateOrg.orgtel,
    parentorg: updateOrg.parentorg,
    parentorgname: updateOrg.parentorgname, orgtype: updateOrg.orgtype, header: updateOrg.header, headername: updateOrg.headername
  }
  return concrete.module('SysorgService').updateSysorg(data)
}
export function fetchPerList(query,searchData) {
  const  data ={
    condition:{},
    num:query.page,
    pageSize:query.limit
  }
  return concrete.module('SysComponentService').lovBaserecords(data,searchData.querypara,searchData.recordZw)
}

